MCPcopy Create free account
hub / github.com/NetHack/NetHack / insertItem

Method insertItem

outdated/win/Qt3/qt3_win.cpp:1879–1910  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1877 }
1878
1879 void insertItem(int attr, const char* text)
1880 {
1881 setTopCell(count);
1882
1883 setAutoUpdate(FALSE);
1884
1885 int i;
1886 if (count<maxitems) {
1887 i=count++;
1888 setNumRows(count);
1889 } else {
1890 i=count-1;
1891 first=(first+1)%maxitems;
1892 }
1893 item(i).attr=attr;
1894 item(i).text=strdup(text);
1895 int w=datumWidth(item(i));
1896
1897 if (w > cellWidth()) {
1898 // Get wider.
1899 setCellWidth(w);
1900 }
1901 setTopCell(count);
1902
1903 setAutoUpdate(TRUE);
1904
1905 if (viewHeight() >= totalHeight()-cellHeight()) {
1906 repaint();
1907 } else {
1908 scroll(0,cellHeight());
1909 }
1910 }
1911
1912 virtual void setFont(const QFont& font)
1913 {

Callers 4

MainMethod · 0.80
NetHackQtSettingsMethod · 0.80
PutStrMethod · 0.80
NetHackQtMainWindowMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected